package com.etc.jdk22;

import java.math.BigInteger;
public class PositiveBigInteger extends BigInteger {

    public PositiveBigInteger(long value) {
        super(verifyPositive(value));
        System.out.println("PositiveBigInteger");
    }

    private static String verifyPositive(long value) {
        System.out.println("verifyPositive");
        if (value <= 0) {
            throw new IllegalArgumentException("non-positive value");
        }
        return  String.valueOf(value);
    }

    public static void main(String[] args) {
        new PositiveBigInteger(1);
    }
}